package com.buptlogistics.creditinvestigation.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.buptlogistics.creditinvestigation.R;
import com.buptlogistics.creditinvestigation.activity.CommonActivity;
import com.buptlogistics.creditinvestigation.app.BaseFragment;

/**
 * 发货通知
 */
public class DeliveryAlertFragment extends BaseFragment {

    private View view;

    private Button btn_commit;
    private Button btn_add;

    public DeliveryAlertFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        view = inflater.inflate(R.layout.fragment_delivery_alert, container, false);
        initViews();
        initEvents();
        return view;
    }

    protected void initViews() {
        btn_commit = (Button) findViewById(R.id.btn_delivery_alert_commit);
        btn_add = (Button) findViewById(R.id.btn_delivery_alert_add);
    }

    protected void initEvents() {
        btn_commit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Bundle data = new Bundle();
                data.putInt("fragmentType", 12);
                // 创建一个Intent
                Intent intent = new Intent(DeliveryAlertFragment.this.getActivity(), CommonActivity.class);
                intent.putExtras(data);
                // 启动intent对应的Activity
                startActivity(intent);
            }
        });

    }

    protected View findViewById(int id) {
        return view.findViewById(id);
    }

}
